Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jsonp tck #232

Merged
merged 4 commits into from
Jul 15, 2020
Merged

Jsonp tck #232

merged 4 commits into from
Jul 15, 2020

Conversation

jbescos
Copy link
Member

@jbescos jbescos commented Feb 19, 2020

Similarly as it is done in Jsonb as API and Yasson as implementation, I have added CTS tests in Jsonp.

The idea is that any Jsonp implementation (including jsonp/impl) can easily execute CTS tests.

TCK folder:
It contains the tests that already exists under: https://github.com/eclipse-ee4j/jakartaee-tck/tree/master/src/com/sun/ts/tests/jsonp

I had to do some modifications in the tests, but not in the logic:

  • Adding support to JUnit and Arquillian. So many Test, RunWith, Deployment were added.
  • Removal of unnecessary dependencies: JsonPTest, ServiceEETest, EETest, TestUtil.
  • Renaming of packages "com.sun.ts.tests.jsonp" -> "jakarta.jsonp.tck"
  • In current jakartaee-tck there is no migration from javax to jakarta yet, but this in jsonp repository it is in place. So the tests were modified to use the packages "jakarta" instead of "javax". There is other PR in jakartaee-tck that address the same but it is not merged yet because we need updated glassfish: Migration of javax.json to jakarta.json platform-tck#147

Sigtests are not included yet. I checked that for jsonb is not in place either. I need to think about re-usability of common classes that other projects (jpa, ejb, jsonp, jsonb, etc) requires. Or we can always copy paste them everywhere.

Impl-TCK folder:
Here it run the current implementation to CTS tests.

Travis will run the CTS tests automatically so we can find issues without releasing a new Glassfish.

Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
@jbescos
Copy link
Member Author

jbescos commented Feb 19, 2020

@aguibert I cannot add you as reviewer but it makes sense that you take a look on this if you want.

<version>1.0.0-SNAPSHOT</version>
</parent>

<artifactId>jakarta.json-tck-tests-plugability</artifactId>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are there 3 poms in the impl-tck folder? It's not clear how "plugability" tests are different from the other ones

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See it in my comment below. In summary some tests are running with a custom json provider and others don't.

Comment on lines +34 to +36
<module>tck-common</module>
<module>tck-tests</module>
<module>tck-tests-plugability</module>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not sure why there are 3 separate modules here. Seems like there could just be one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In current jakartaee-tck, when you execute the jsonp tests it generates a separate jar named "jsonp_alternate_provider.jar". It is done in that way because
Plugability is running the tests with a custom json provider in /META-INF/services.


import junit.framework.AssertionFailedError;

public class Fault extends AssertionFailedError {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This exception class isn't really needed. Can just use the standard junit exceptions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it in that way to dramatically decrease the modifications in the CTS tests. There are many methods throwing that Fault.

We need to live for some time with this copy-pasted tests, so if a modification happens in jakartaee-tck, we need to update this tests too. For the human eye it will be easier to see differences.

@aguibert
Copy link

Thanks for looking into this @jbescos! I added some comments mainly around the project structure.

However, I think we should try to nail down a strategy on the mailing list before other specs try to copy the proposal I did for JSON-B. My ultimate goal is to move the TCKs from the monorepo to the spec repos (as opposed to duplicating them), but we don't yet have agreement on that.

@jbescos
Copy link
Member Author

jbescos commented Feb 20, 2020

@aguibert thanks for reviewing it. Definitely this simplifies a lot the execution of CTS tests for different implementations. I'm afraid it is not doable for all cases, because some tests requires a running web application server.

Copy link
Contributor

@lukasj lukasj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lukasj lukasj merged commit 8a924b4 into jakartaee:master Jul 15, 2020
@scottmarlow scottmarlow mentioned this pull request Sep 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants